package com.itcam.interview.pro00.disignmodel.decoration;

// 测试类
public class CoffeeShopDecoratorExample {
    public static void main(String[] args) {
        // 点一杯浓缩咖啡
        Beverage espresso = new Espresso();
        System.out.println(espresso.getDescription() + " 价格: $" + espresso.cost());

        // 给浓缩咖啡加牛奶和糖
        Beverage decoratedEspresso = new Sugar(new Milk(espresso));
        System.out.println(decoratedEspresso.getDescription() + " 价格: $" + decoratedEspresso.cost());

        // 再给加了牛奶的浓缩咖啡加摩卡
        decoratedEspresso = new Mocha(decoratedEspresso);
        System.out.println(decoratedEspresso.getDescription() + " 价格: $" + decoratedEspresso.cost());

        // 点一杯拿铁
        Beverage latte = new Latte();
        System.out.println(latte.getDescription() + " 价格: $" + latte.cost());

        // 给拿铁加牛奶
        Beverage decoratedLatte = new Milk(latte);
        System.out.println(decoratedLatte.getDescription() + " 价格: $" + decoratedLatte.cost());
    }
}